#!/usr/bin/env python
import os
from distutils.core import setup
packages = []
data_files = []
def fullsplit(path, result=None):
    """
    Split a pathname into components (the opposite of os.path.join) in a
    platform-neutral way.
    """
    if result is None:
        result = []
    head, tail = os.path.split(path)
    if head == '':
        return [tail] + result
    if head == path:
        return result
    return fullsplit(head.replace('src', ''), [tail] + result)

for dirpath, dirnames, filenames in os.walk('src'):
    for i, dirname in enumerate(dirnames):
        if dirname.startswith('.'): del dirnames[i]
    if '__init__.py' in filenames:
        packages.append('.'.join(fullsplit(dirpath)))
    elif filenames:
        data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]])
setup(name='dopplershift',
      version='0.1',
      description='DopplerShift patterns wrapper collection for python application developers for using with pyqt, twisted, pylons/pyramid, django or developer own frameworks/libraries.',
      author='Boris S.Bobejko',
      author_email='mr.kerah@redpandaz.net',
      url='http://code.google.com/p/dopplershift/',
      packages=packages,
      scripts=['run/ds-collector', 'run/ds-autotest'],
      package_dir={
                   '': 'src'
                   },
      classifiers=[
                   'Development Status :: 4 - Beta',
                   'Environment :: Console',
                   'Environment :: Web Environment',
                   'Intended Audience :: Developers',
                   'Intended Audience :: System Administrators',
                   'License :: OSI Approved :: LGPL',
                   'Operating System :: POSIX',
                   'Programming Language :: Python',
                   ]
     )

